Cancellations and Returns
Note: Spartacus 2.x is no longer maintained. Please upgrade to the latest version.
Note: This feature is introduced with version 1.4 of the Spartacus libraries.
Overview
The Cancellations and Returns feature in Spartacus allows customers to request a complete or partial cancellation for an order that has been placed, or a return for an order that has already been received. This allows customers to bypass having to call a customer service agent to cancel or return an order that was placed.
For more information, see Order Cancel Service and Return Service on the SAP Help Portal.
Back-End Requirements
The Cancellations and Returns feature in Spartacus requires SAP Commerce Cloud version 2005.0 or newer. The minimum version of 2005.0 is required because earlier versions do not include the endpoints related to this feature.
You should also consider installing Order Management in the back end. For more information, see Installing Order Management on the SAP Help Portal.
Enabling Cancellations and Returns in Spartacus
The Cancellations and Returns feature is disabled by default in Spartacus.
Since the feature is CMS-driven, the only way to enable it is through the CMS. The following procedure describes the changes you should make to the spartacussampledataaddon
AddOn, or to your own, custom AddOn.
Note: All of the required CMS data is already included in the spartacussampledataaddon
AddOn.
Enabling Cancellations and Returns through the CMS
-
Import the following ImpEx to make the
AccountOrderDetailsActionsComponent
visible:INSERT_UPDATE CMSFlexComponent;$contentCV[unique=true];uid[unique=true];visible ;;AccountOrderDetailsActionsComponent;true
When this ImpEx is imported, the cancel or return action buttons are displayed on the Order Details page. The following is an example:
-
Add the All Orders and Returns tabs to the Order History page by importing the following ImpEx:
UPDATE ContentSlot;$contentCV[unique=true];uid[unique=true];cmsComponents(uid, $contentCV) ;;BodyContent-orders;AccountOrderHistoryTabContainer
By replacing the
AccountOrderHistoryComponent
with theAccountOrderHistoryTabContainer
component in theBodyContent-orders
slot, you can then see tabs in the Order History page, as follows:These steps can also be done in Backoffice.
Configuring
No special configuration is required.
Extending
No special extensibility is available for this feature.